﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZR.Model;

namespace ImportPlcPointPosition.Models
{
    [SugarTable("cks_virtual_table")]
    public class CksVirtualTable: BaseEntity
    {
        [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)]
        public int Id {  get; set; }
        public string TableName {  get; set; }

        public int Sequence {  get; set; }

        public string LanguageKey {  get; set; }=string.Empty;

        public string Notes {  get; set; } = string.Empty;

    



        public DateTime CreatedTime {  get; set; } = DateTime.Now;
    }

    [SugarTable("cks_virtual_column")]
    public class CksVirtualColumn: BaseEntity
    {
        private bool isPrimary;
        private bool isResult;
        [SugarColumn(ColumnName = "Id", IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }

        [SugarColumn(IsIgnore =true)]
        public Guid Guid { get; set; } = Guid.NewGuid();

        public int TableId { get; set; }

        public string ColumnName { get; set; } = string.Empty;

        public string Notes { get; set; } = string.Empty;

        public int Sequence { get; set; } = 99;

        public int DataId { get; set; }
        /// <summary>
        /// 客户端是否展示
        /// </summary>
        public bool IsDisplay { get; set; }

        public bool IsPrimary { get => isPrimary;
            set {
                isPrimary = value;
                OnPropertyChanged("IsPrimary");
            } }


        public bool IsResult
        {
            get => isResult;
            set
            {
                isResult = value;
                OnPropertyChanged("IsResult");
            }
        }
        /// <summary>
        /// 宽度
        /// </summary>
        public int Width {  get; set; }

        public string LanguageKey { get; set; } = string.Empty;

        public DateTime CreatedTime { get; set; } = DateTime.Now;
    }



}
